#include <iostream>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

int main(){
    int client_socket=socket(AF_INET,SOCK_STREAM,0);
    if(client_socket < 0){
        std::cout<<"Client socket Error"<<std::endl;
        return -1;
    }
    sockaddr_in server_addr;
    server_addr.sin_family=AF_INET;
    server_addr.sin_port=htons(6666);
    const char *server_ip="127.0.0.1";
    char buffer[1024];
    //生成了网络字节序的IP整数。
    inet_pton(AF_INET,server_ip,&(server_addr.sin_addr.s_addr));
    std::cout<<"Pton"<<std::endl;
    connect(client_socket,reinterpret_cast<sockaddr*>(&server_addr),sizeof(server_addr));
    close(client_socket);
}
